package chp07;

import java.util.Arrays;

public class Test14b {

    public static void main(String[] args) {
        //数组拷贝，需要数组里面的内容每个都进行拷贝
        int[] nums1 = {12,45,78,4,21};
        int[] nums2 = new int[nums1.length];
        for (int i = 0; i < nums1.length; i++) {
            nums2[i] = nums1[i];
        }

        System.out.println(Arrays.toString(nums1));
        System.out.println(Arrays.toString(nums2));
        nums1[0] = 100;
        System.out.println("--------------");
        System.out.println(Arrays.toString(nums1));
        System.out.println(Arrays.toString(nums2));
    }
}
